<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>石头剪刀布</title>
</head>
<body>
<div id="app">
    <div>player:    {{player}}</div>
    <div>computer:   {{computer}}</div>
    <div v-if="isWin">Win</div>
    <div v-else>Lose</div>
</div>
</body>
<script src="../../lib/vue.js"></script>
<script>
    new Vue({
        el:'#app',
        data:{
            player:'rock',
            computer:'scissors'
        },computed:{
            isWin:function () {

                var flag=false;
                if(this.player=='rock'&&this.computer=='scissors'){
                     flag=true;
                }

                return flag;
            }
        }
    })
</script>
</html>